package com.journey.org.ui.knowledge.gankio.list

import android.os.Bundle
import com.journey.org.entity.GankArticleEntity
import com.journey.org.ui.knowledge.gankio.detail.GankDetailFragment
import com.mvvmhabit.org.base.ItemViewModel
import com.mvvmhabit.org.binding.command.BindingAction
import com.mvvmhabit.org.binding.command.BindingCommand

/**
 * @Date: 2020/12/17 11:41
 * @Author:小妖
 * @Description:
 */
class GankListItemViewModel(vm: GankListViewModel, val entity: GankArticleEntity) :
    ItemViewModel<GankListViewModel>(vm) {

    val onEnterDetailCommand = BindingCommand<Any>(object : BindingAction {
        override fun call() {
            val bundle = Bundle()
            bundle.putString("id", entity._id)
            viewModel.startContainerActivity(GankDetailFragment::class.qualifiedName, bundle)
        }
    })

}